summaryrefslogtreecommitdiff
path: root/app/[lng]/auth/reset-password/page.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-06-27 01:16:20 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-06-27 01:16:20 +0000
commite9897d416b3e7327bbd4d4aef887eee37751ae82 (patch)
treebd20ce6eadf9b21755bd7425492d2d31c7700a0e /app/[lng]/auth/reset-password/page.tsx
parent3bf1952c1dad9d479bb8b22031b06a7434d37c37 (diff)
(대표님) 20250627 오전 10시 작업사항
Diffstat (limited to 'app/[lng]/auth/reset-password/page.tsx')
-rw-r--r--app/[lng]/auth/reset-password/page.tsx47
1 files changed, 47 insertions, 0 deletions
diff --git a/app/[lng]/auth/reset-password/page.tsx b/app/[lng]/auth/reset-password/page.tsx
new file mode 100644
index 00000000..f49e5d86
--- /dev/null
+++ b/app/[lng]/auth/reset-password/page.tsx
@@ -0,0 +1,47 @@
+// app/[lng]/auth/reset-password/page.tsx
+
+import { redirect } from 'next/navigation';
+import { validateResetTokenAction } from '@/lib/users/auth/partners-auth';
+import InvalidTokenPage from '@/components/login/InvalidTokenPage';
+import ResetPasswordForm from '@/components/login/reset-password';
+import { getPasswordPolicy } from '@/lib/users/auth/passwordUtil';
+
+interface Props {
+ searchParams: { token?: string };
+}
+
+export default async function ResetPasswordPage({ searchParams }: Props) {
+ const token = searchParams.token;
+
+ // 토큰이 없는 경우 로그인 페이지로 리다이렉트
+ if (!token) {
+ redirect('/partners');
+ }
+
+ // 서버에서 토큰 검증
+ const tokenValidation = await validateResetTokenAction(token);
+
+ // 토큰이 유효하지 않은 경우
+ if (!tokenValidation.valid) {
+ return (
+ <InvalidTokenPage
+ expired={tokenValidation.expired || false}
+ error={tokenValidation.error}
+ />
+ );
+ }
+
+ // 패스워드 정책 로드
+ const passwordPolicy = await getPasswordPolicy();
+
+ // 유효한 토큰인 경우 폼 표시
+ return (
+ <div className="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
+ <ResetPasswordForm
+ token={token}
+ userId={tokenValidation.userId!}
+ passwordPolicy={passwordPolicy}
+ />
+ </div>
+ );
+} \ No newline at end of file